//职位管理有内容
import React, {Component} from 'react'
import {
    View,
    Text,
    Image,
    TouchableOpacity,
} from 'react-native';


import {Cbrowselist_Style as styles} from '../../../../styles';
import Icon from 'react-native-vector-icons/Ionicons';
import {common_url} from "../../../util/fetch";



let Dimensions = require('Dimensions');
let width = Dimensions.get('window').width;


export default class Cbrowse_list extends Component {
    constructor(props) {
        super(props);
    }

    render() {
        return (
            <TouchableOpacity style={styles.bro_all} activeOpacity={1}
                              onPress={() => {
                                  this.props.navigation.navigate('Cresume_all', {resumeId: this.props.resume.resumeId})
                              }}>
                <View style={styles.bro_left}>
                    <Image source={
                        this.props.resume.resumeIntentField ?
                            {uri: common_url + "uploadImg/" + this.props.resume.resumeIntentField}
                            : require('../../../img/app/boy.png')} style={styles.bro_head}/>
                    <Text style={styles.bro_name}>{this.props.resume.resumeName}</Text>
                </View>

                <View style={styles.bro_right}>

                    <View style={styles.bro_eve1}>
                        <Text style={styles.bro_pos}>{this.props.resume.resumeIntentPosition}</Text>
                        {this.props.resume.resumeSex === 1 ?
                            < Icon
                                name={'ios-male'}
                                size={15}
                                color={'#3d9ccc'} style={styles.bro_icon}/>
                            :
                            <Icon
                                name={'ios-female'}
                                size={15}
                                color={'#fc6866'} style={styles.bro_icon}/>
                        }
                    </View>

                    <View style={styles.bro_eve3}>
                        <Text style={styles.bro_area}>{this.props.resume.resumeWorkspace}</Text>
                        <Text style={styles.bro_area}>{(new Date().getFullYear() - this.props.resume.resumeWorkinglife)}年工作经验</Text>
                        <Text style={styles.bro_area}>{this.xzResumeEducations(this.props.resume.xzResumeEducations)}</Text>
                        {/* {this.xzResumeEducations(this.props.xzResumeEducations)} */}
                    </View>

                    <View style={[styles.bro_eve4, {width: width * 0.7}]}>
                        <Text style={styles.bro_time}>2000-00-00</Text>
                    </View>

                </View>
            </TouchableOpacity>
        )
    }
    xzResumeEducations(Educations) {
        let arr = '';
        if (Educations != undefined) {
            for (let i = 0; i < Educations.length; i++) {
                if (Educations[i].educationLevel == '博士') {
                    return arr = '博士';
                } else if (Educations[i].educationLevel == '硕士') {
                    return arr = '硕士';
                } else if (Educations[i].educationLevel == '本科') {
                    return arr = '本科';
                } else if (Educations[i].educationLevel == '大专') {
                    return arr = '大专';
                } else if (Educations[i].educationLevel == '中专') {
                    return arr = '中专';
                } else if (Educations[i].educationLevel == '初中') {
                    return arr = '初中';
                }
            }
        } else {
            return arr;
        }
    }
}